<style lang="less" scoped src="./org-major.less"></style>
<script src="./org-major.js"></script>

<template>
    <div>
        <div class="main-table">
            <Table border :columns="columns" :data="data"></Table>
        </div>
        <Modal v-model="editModal"
               :title="editTitle"
               width="60%"
               :mask-closable="false"
               @on-cancel="editModal = false">
            <Form :model="formData" :label-width="80">
                <FormItem label="部门名称">
                    <Input v-model="formData.name" :readonly="true" style="width: 60%"></Input>
                </FormItem>
                <FormItem label="专业">
                    <Input v-model="names" :readonly="true" @on-click="getMajorList" icon="search"></Input>
                </FormItem>
            </Form>
            <div slot="footer">
                <Button type="primary" @click="save">保存</Button>
                <Button type="ghost" style="margin-left: 8px" @click="editModal = false">取消</Button>
            </div>
        </Modal>
        <Modal v-model="treeModal"
               title="选择专业"
               width="40%"
               :mask-closable="false"
               @on-ok="setMajor"
               @on-cancel="treeModal = false">
            <div class="tree">
                <Tree :data="majorList" ref="majorList" show-checkbox></Tree>
            </div>
        </Modal>
    </div>
</template>